import { createRouter,createWebHistory } from "vue-router";
import Home from '../components/Home.vue';
import About from '../components/About.vue';
import User from '../../views/User.vue'
import UserHome from '../../views/UserHome.vue';
import UserProfile from '../../views/UserProfile.vue';
import UserPosts from '../../views/UserPosts.vue';

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      {path: 'about',component: About},
      {path: 'user',component: User},
    ]
  },
  {
    path: "/about",
    name: "About",
    component: About
  },
  {
    path: "/userhome",
    name: "UserHome",
    component: UserHome
  },
  {
    path: "/userprofile",
    name: "UserProfile",
    component: UserProfile
  },
  {
    path: "/userposts",
    name: "UserPosts",
    component: UserPosts
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes: routes
});
export default router;